import { message } from 'antd';
import React,{Component} from 'react';
import videoBarImg from '../../assets/image/视频柱状图.png';
import {reqVideoBarById} from '../../api';

class VideoBarShow extends Component{
  state = {
    videoBarImg: videoBarImg
  }

  getVideoBar = async() => {
    const video_id = this.props.videoId;
    const result = await reqVideoBarById(video_id);
    if(result.code === 200){
      const videoBarImg = result.code;
      this.setState({
        videoBarImg
      })
    }else{
      message.error(result.data);
    }
  }

  componentWillMount(){
    this.getVideoBar();
  }
  render(){
    return(
      <div>
        <img src={this.state.videoBarImg} alt="视频柱状图"></img>
      </div>
    )
  }
}

export default VideoBarShow;